import React from 'react'
import { HashRouter, Route, Switch, Redirect } from 'react-router-dom'
import App from '../App'
import login from '../pages/login/index'
import Layout from '../components/lauout'
import statistics from '../pages/statistics/index'
import table from '../pages/table/index'
export default class IRouter extends React.Component {

  render() {
    return (
      
      <HashRouter>
        <App>
          <Switch>
            <Route path="/login" component={login} />
            {/* <Route path="/common" render={() =>
              <Common>
                <Route path="/common/order/detail/:orderId" component={OrderDetail} />
              </Common>
            }
            /> */}
            <Route path="/" render={() =>
              <Layout $router={this}>
                <Switch>
                  <Route path="/statistics" component={statistics} />
                  <Route path="/table" component={table} />
                  <Redirect from="/" to="/login" />
                  {/* <Route component={NoMatch} /> */}
                </Switch>
              </Layout>
            } />
          </Switch>
        </App>
      </HashRouter>
    );
  }
}